package com.pers.springcloud.controller;

import com.pers.springcloud.entities.JSONResult;
import com.pers.springcloud.entities.Payment;
import com.pers.springcloud.service.PaymentFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 黄建
 * @Date: 2020/3/8 21:58
 */
@RestController
@RequestMapping("/consumer")
public class OrderFeignController {

    @Autowired
    private PaymentFeignService paymentFeignService;

    @GetMapping(value = "/payment/get/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
    public JSONResult<Payment> getPaymentById(@PathVariable(value = "id") Long id) {
        return paymentFeignService.getPayment(id);
    }
}
